<?php

use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\BrandController;
use App\Http\Controllers\Api\CatalogController;
use App\Http\Controllers\Api\GoodsController;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

// 用户注册
Route::post('auth/register',[AuthController::class,'register']);
//  发送短信验证码
Route::post('auth/regCode',[AuthController::class,'regCode']);
// 登陆
Route::post('auth/login',[AuthController::class,'login']);
// 重置密码
Route::post('auth/reset',[AuthController::class,'reset']);
//分类目录全部分类数据接口
Route::get('catalog/index', [CatalogController::class,'index']);
//分类目录当前分类数据接口
Route::get('catalog/current', [CatalogController::class,'current']);
//品牌列表
Route::get('brand/list', [BrandController::class,'list']);
//品牌详情
Route::get('brand/detail', [BrandController::class,'detail']);
//统计商品总数
Route::get('goods/count', [GoodsController::class,'count']);
//根据分类获取商品列表数据
Route::get('goods/category', [GoodsController::class,'category']);
//获得商品列表
Route::get('goods/list', [GoodsController::class,'list']);
//获得商品的详情
Route::get('goods/detail', [GoodsController::class,'detail']);
// 需要登陆的接口
Route::group(['prefix'=> 'v1','middleware'=>'auth:wx'],function(Router $router){
    // 获取登陆用户信息
    $router->get('auth/info',[AuthController::class,'info']);
    // 退出登陆
    $router->post('auth/logout',[AuthController::class,'logout']);
    // 修改手机号
    $router->post('auth/captcha',[AuthController::class,'captcha']);
    // 修改用户信息
    $router->post('auth/profile',[AuthController::class,'profile']);
    // 收获地址列表
    $router->get('address/list',[AuthController::class,'list']);
    // 收获地址详情
    $router->get('address/detail',[AuthController::class,'detail']);
    // 保存收获地址
    $router->post('address/save',[AuthController::class,'save']);
    // 删除收获地址
    $router->post('address/delete',[AuthController::class,'delete']);
});
